<?php
//--------------------------------------------------
//	Filename: gym_list.php
//--------------------------------------------------
// Information:
// This file shows Where our members workout. 
//--------------------------------------------------
if( !defined('IN_INDEX') )
{
	printError("ACCESS DENIED", "This page is hidden.");
	exit;
}

include('inc/functions_gym.php');

if(!checkSession())
{
			function redirect($url)
			{
			?>
				<script type="text/javascript">
					{
						window.location = "<?=$url?>";
					}
				</script>
			<?php 
			}
			redirect("index.php?action=login");
	exit;
}

?>

<div id="postpath">
	
	<?php	
		echo translate('gym_list_view');
	?>	 
</div>
<br /><br />
<?php $array_gym_activated = list_all_gyms_activated(); ?>
<?php if(!empty( $array_gym_activated )): ?>
	<div style="float:left;width:35%;">
		<?php 
			foreach($array_gym_activated as $array){
				echo "<a href='index.php?action=gym&sub=view&gym_id=".$array['gym_id']."'>".$array['gym_name']." ( ".count_total_members_used($array['gym_id'])." )</a>"."<br/>";
			}
		?>
	</div>
	<div style="float:left;width:65%;">
		
	</div>

<?php else: ?>
	<?php echo translate('waiting_for_activated');?>

<?php endif; ?>